package cn.s1995.sloth.bizs.service.impl;

import cn.s1995.sloth.bizs.entity.PayFlow;
import cn.s1995.sloth.bizs.mapper.PayFlowMapper;
import cn.s1995.sloth.bizs.service.PayFlowService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 支付流水
 *
 * @author Lex
 * @date 2024-01-05 08:28:27
 */
@Service
public class PayFlowServiceImpl extends ServiceImpl<PayFlowMapper, PayFlow> implements PayFlowService {

    @Override
    public PayFlow getPayFlow(String payFlowId) {
        return getById(payFlowId);
    }

    @Override
    public PayFlow getPayFlowByTransactionId(String transactionId) {
        return getOne(
                Wrappers.lambdaQuery(PayFlow.class)
                        .eq(PayFlow::getTransactionId, transactionId),
                Boolean.FALSE
        );
    }
}
